package com.donleo.cn.reflex;

import java.util.Date;

/**
 * @author liangd
 * date 2020-11-17 09:31
 * code 测试反射实体类
 */
public class Book  {
    /**
     * 静态变量，new多个对象，同时对静态变量赋值，最后结果以最后赋值的为准
     */
    public static String category;

    //成员变量
    /**
     * 书名
     */
    private String name;
    /**
     * 作者
     */
    private String author;
    /**
     * 发布时间
     */
    private Date publishTime;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", publishTime=" + publishTime +
                '}';
    }

    /**
     * 无参构造器
     */
    public Book() {

    }

    /**
     * 有参构造器
     */
    public Book(String name, String author, Date publishTime) {
        this.name = name;
        this.author = author;
        this.publishTime = publishTime;
    }

    /**
     * 成员方法
     */
    public void declaredMethod(){
        System.out.println("declaredMethod ...");
    }
}
